home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1101 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.2 KB

  1. Date: Sat, 26 Feb 1994 23:37:03 -0500
  2. From: "Nicholas S Castellano" <entropy@terminator.rs.itd.umich.edu>
  3. To: mint@terminator.rs.itd.umich.edu
  4. Subject: Job control fix
  5.  
  6. Here's a patch to fix job control handling.  Don't be surprised if
  7. you get some offsets while applying the patch,
  8.  
  9. tty.c: ++entropy@terminator.rs.itd.umich.edu
  10.     Fix SIGTTIN/SIGTTOU job control.
  11.  
  12. --- 1.10.1.3    1994/02/27 04:03:08
  13. +++ tty.c    1994/02/27 04:14:34
  14. @@ -658,8 +658,16 @@
  15.      }
  16.  
  17.  /* job control check */
  18. -
  19. -    if (tty->pgrp && tty->pgrp != curproc->pgrp) {
  20. +/*
  21. +entropy: only do the job control if SIGTTIN is neither blocked nor ignored,
  22. +and only for the controlling tty (IEEE 1003.1-1990 7.1.1.4 70-78).
  23. +BUG:  if the process group is orphaned or SIGTTIN *is* blocked or ignored,
  24. +we should return EIO instead of signalling.
  25. +*/
  26. +
  27. +    if ((tty->pgrp && tty->pgrp != curproc->pgrp) &&
  28. +            (f->fc.dev == curproc->control->fc.dev) &&
  29. +            (f->fc.index == curproc->control->fc.index)) {
  30.          TRACE(("job control: tty pgrp is %d proc pgrp is %d",
  31.              tty->pgrp, curproc->pgrp));
  32.          killgroup(curproc->pgrp, SIGTTIN);
  33. @@ -787,8 +795,18 @@
  34.      }
  35.  /* job control checks */
  36.  /* AKP: added T_TOSTOP; don't stop BG output if T_TOSTOP is clear */
  37. +/*
  38. +entropy: only do the job control if SIGTTOU is neither blocked nor ignored,
  39. +and only for the controlling tty (IEEE 1003.1-1990 7.1.1.4 79-87).
  40. +BUG:  if the process group is orphaned and SIGTTOU *is not* blocked
  41. +or ignored, we should return EIO instead of signalling.
  42. +*/
  43.      if (tty->pgrp && tty->pgrp != curproc->pgrp &&
  44. -             (tty->sg.sg_flags & T_TOSTOP)) {
  45. +             (tty->sg.sg_flags & T_TOSTOP) &&
  46. +                 (curproc->sighandle[SIGTTOU] != SIG_IGN) &&
  47. +                 ((curproc->sigmask & (1L << SIGTTOU)) == 0L) &&
  48. +                 (f->fc.dev == curproc->control->fc.dev) &&
  49. +                 (f->fc.index == curproc->control->fc.index)) {
  50.          TRACE(("job control: tty pgrp is %d proc pgrp is %d",
  51.              tty->pgrp, curproc->pgrp));
  52.          killgroup(curproc->pgrp, SIGTTOU);
  53.  
  54. --
  55. entropy -- it's not just a good idea, it's the second law.
  56. Personal mail:      entropy@gnu.ai.mit.edu
  57. MiNT library mail:  entropy@terminator.rs.itd.umich.edu
  58. "what do you have against octal?" -jrb
  59.  
  60.